import { useStorage } from '@vueuse/core'
import { defineStore } from 'pinia'

export const useBarStore = defineStore('bar', {
    state: () => {
        return {
            sessionTabList: useStorage(
                'tabList',
                [{
                    name:'route.index.meta.title',
                    componentName:'index',
                    path:'/index'
                }],
                sessionStorage,
            ),
        }
    },
    getters:{
        getSessionTabList(state) {
            return state.sessionTabList
        },
    },
    actions:{
        setSessionTabList(){
            this.sessionTabList = [{
                name:'route.index.meta.title',
                componentName:'index',
                path:'/index'
            }]
        }
    }
})

export default {
    useBarStore
}